package com.forum.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.forum.pojo.UserMessage;
import com.forum.pojo.vo.ChatListVo;
import java.util.Date;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @Entity com.forum.pojo.UserMessage
*/
@Mapper
public interface UserMessageMapper extends BaseMapper<UserMessage> {


    String getUserSignature(@Param("userId") Long userId);

    boolean updateState(@Param("userId")Long userId,@Param("friendId")Long friendId);

    void deleteFriend(@Param("userId") Long userId, @Param("friendId") Long friendId);

    List<UserMessage> getChat(@Param("userId")Long userId,  @Param("friendId")Long friendId);

    List<ChatListVo> getChatList(@Param("userId") Long userId);

    void deleteByArticleIdAndUserId(@Param("objectId")String objectId,@Param("userId") Long userId);

    void deleteByCommentIdAndUserId(@Param("objectId")String objectId,@Param("userId") Long userId);

    void deleteByContentAndPostTime(@Param("content") String content,@Param("postTime") Date postTime);

    void deleteByArticleId(@Param("articleId")String articleId);
}
